import { FC, useState } from 'react';
import TsChild from './components/TsChild';

const Index: FC = () => {
  const [count, setCount] = useState<number>(1);

  const add = (): void => {
    setCount((v) => v + 1);
  };

  return (
    <div>
      <h2>typescript</h2>
      <p>{count}</p>
      <button onClick={add}>+</button>
      <TsChild count={count} name="zhangsan" />
    </div>
  );
};

export default Index;
